<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
<title> Evaluating expressions </title>
</head>
<body>
<h1> Evaluating Expressions </h1>
<p> In this section, you will evaluate expressions in the context of your
running Java program. </p>
<ol>
  <li> Debug <em>junit.samples.VectorTest.java</em> to the breakpoint in the
    <code>setUp()</code> method and select <b>Step Over</b> twice to populate <code>fFull</code>.&nbsp; (See the <a href="qs-13.htm">Debugging your Programs</a> section for full
    details.)<br>
  </li>
  <li>Open the Debug Shell view by selecting <b>Window &gt; Show View &gt; Display</b> 
    and type the following line in the view:
    <p> <code>fFull.size()</code></p>
  </li>
  <li> Select the text you just typed, and from its context menu, select <strong>Display</strong>.&nbsp;
    (You can also choose <strong>Display Result of Evaluating Selected Text </strong> (<img src="../images/org.eclipse.jdt.debug.ui/etool16/disp_sbook.svg" alt="Display" >) from
    the Debug Shell view toolbar.) 
    <p> <img src="images/view_debugshell_display.png"  alt="Debug Shell view with fFull.size selected and showing context menu"> 
    </p>
  </li>
  <li> The expression is evaluated and the result is displayed in the Display
    view. 
    <p> <img src="images/view_debugshell_display_done.png"  alt="Debug Shell view showing evaluation result: (int) 2"> 
    </p>
  </li>
  <li> On a new line in the Debug Shell view, type the following line: 
    <p> <code>fFull.toArray()</code> </p>
  </li>
  <li> Select this line, and select <strong>Inspect</strong> from the context
    menu.&nbsp; (You can also choose <strong>Inspect Result of Evaluating
    Selected Text </strong> (<img src="../images/org.eclipse.jdt.debug.ui/etool16/insp_sbook.svg" alt="Inspect" >) from the Debug Shell view toolbar.) </li>
  <li>A lightweight window opens with the value of the evaluated expression. 
    <p> <img src="images/view_debugshell_inspect.png"  alt="Pop-up containing fFull.toArray() expression"> 
    </p>
  </li> 
</ol>
<P class="nav_footer" id="nav_footer">Next Section: <A href="qs-15.htm">Evaluating snippets</A>
</P>
<h3 class="related">Related Concepts</h3>
  <a href="../concepts/cdebugger.htm">Debugger</a>

<h3 class="related">Related Tasks</h3>
  <a href="../tasks/task-evaluating_expressions.htm">Evaluating expressions</a><br>
  <a href="../tasks/task-display_evaluation_result.htm">Displaying the result of evaluating an expression</a><br>
  <a href="../tasks/task-inspect_evaluation_result.htm">Inspecting the result of evaluating an expression</a>

<h3 class="related">Related References</h3>
  <a href="../reference/views/expressions/ref-expressions_view.htm">Expressions view</a>

</body>
</html>

